]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
endSessionDialog: Catch async errors
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 15 Mar 2023 19:11:39 +0000 (20:11 +0100)
committerMarge Bot <marge-bot@gnome.org>
Sun, 19 Mar 2023 19:54:45 +0000 (19:54 +0000)
Otherwise the actual error is masked by an "unhandled promise
rejection" error, making it harder to track down the underlying
cause.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6506

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2696>

js/ui/endSessionDialog.js

index 66fc2e6f94153b5704ac4f766bd02c87d413fd4c..3de1085ab0def645a756819e5bfa6e880169e0c8 100644 (file)
@@ -235,7 +235,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
 
         this._loginManager = LoginManager.getLoginManager();
         this._canRebootToBootLoaderMenu = false;
-        this._getCanRebootToBootLoaderMenu();
+        this._getCanRebootToBootLoaderMenu().catch(logError);
 
         this._userManager = AccountsService.UserManager.get_default();
         this._user = this._userManager.get_user(GLib.get_user_name());
@@ -449,7 +449,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
                 action: () => {
                     let signalId = this.connect('closed', () => {
                         this.disconnect(signalId);
-                        this._confirm(signal);
+                        this._confirm(signal).catch(logError);
                     });
                     this.close(true);
                 },
@@ -501,7 +501,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
 
     _confirmRebootToBootLoaderMenu() {
         this._loginManager.setRebootToBootLoaderMenu();
-        this._confirm('ConfirmedReboot');
+        this._confirm('ConfirmedReboot').catch(logError);
     }
 
     async _confirm(signal) {
@@ -589,7 +589,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
 
             let dialogContent = DialogContent[this._type];
             let button = dialogContent.confirmButtons[dialogContent.confirmButtons.length - 1];
-            this._confirm(button.signal);
+            this._confirm(button.signal).catch(logError);
             this._timerId = 0;
 
             return GLib.SOURCE_REMOVE;
@@ -759,7 +759,7 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
         }
 
         if (dialogContent.showOtherSessions)
-            this._loadSessions();
+            this._loadSessions().catch(logError);
 
         let updatesAllowed = this._updatesPermission && this._updatesPermission.allowed;